package cn.broadmax.boot.modules.sys.bean.depart;

import cn.broadmax.boot.modules.sys.entity.SysDepartment;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jexx.util.StringUtil;
import lombok.Data;

@Data
@ApiModel("部门查询条件")
public class SysDepartmentSearch {

    @ApiModelProperty("部门名称")
    private String departName;

    public static LambdaQueryWrapper<SysDepartment> createWrap(SysDepartmentSearch search){
        LambdaQueryWrapper<SysDepartment> wrapper = new LambdaQueryWrapper<>();
        if(StringUtil.isNotEmpty(search.getDepartName())){
            wrapper.like(SysDepartment::getDepartName, search.getDepartName());
        }
        return wrapper;
    }

}
